<template>
    <div class="left">
        <ul>
            <li
                v-for="item in list"
                :key="item.id"
                @click="changeStatus(item.id)"
                :class="status == item.id ? 'color' : ''"
            >
                {{ item.name }}
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    data() {
        return {
            list: [
                {
                    id: 1,
                    name: '个人信息'
                },
                {
                    id: 2,
                    name: '皮皮虾'
                },
                {
                    id: 3,
                    name: '皮皮鳝'
                }
            ],
            status: 1
        };
    },
    methods: {
        changeStatus(val) {
            this.status = val;
            console.log(this.status);
            if (val === 1) {
                this.$router.push({
                    path: 'user'
                });
            } else if (val === 2) {
                this.$router.push({
                    path: 'pipi'
                });
            } else {
                this.$router.push({
                    path: 'pipishan'
                });
            }
        }
    }
};
</script>

<style lang="scss" scoped>
.left {
    width: 220px;
    height: calc(100vh - 80px);
    background: #b8b8b8;
    padding-top: 20px;
    ul {
        li {
            margin-top: 10px;
            color: #ffffff;
        }
        li:hover {
            color: aqua;
        }
    }
    .color {
        color: aqua;
    }
}
</style>
